#ifndef Animal_h
#define Animal_h

#include"Entity.h"
#include"TypeEntity.h"
#include<vector>

using namespace std;

//class Ecosystem;

class Animal : public Entity {
public:
	/***** Constructor *****/
	Animal(Ecosystem & _eco, Position const& _position, string _race, float _pEsc, float _pMve, float _pRep, int _tokens, int _maxLife, int _fov)
	: Entity(_eco, _position, _race, _maxLife), pEscape(_pEsc), pMove(_pMve),
		pReproduce(_pRep), tokens(_tokens), maxLife(_maxLife), fov(_fov){ }


        /*
         * Used to get the number of action tokens of the animal
         *
         *  @return Number of action tokens of the animal
         */
	int getTokens() const;			

        //Main state machine of the animal
	void update();				

        // Destructor
	~Animal() {}

	/**
	 * Type of the entity (Animal or Vegetal)
         *
         *  @return Type of the entity (Animal)
	 */
        TypeEntity getTypeEntity() const {
            return ANIMAL;
        }

protected:
        //Used by the animal to look around him and to fill the peeked vector with seen animals.
	void Animal::lookAround();			

protected:
	float               pEscape;
	float               pMove;
	float               pReproduce;
	int                 tokens;
	int                 maxLife;
	int                 fov;
	vector<Entity*>     peeked;
	int                 direction;
};

#endif // Animal_h
